char* a 和 char *a 区别

August 09, 2022

在写 c++的时候发现有两种定义定义指针的方式

方式一

char* a;

方式二

char *a;

其实两者的写法都是可以的,但第一种写法不能同时定义两个指针,比如:

// 以下的b不指针
char* a, b;

而第二种可以:

char *a, *b;

Profile picture

Written by Vance who lives and works in Shenzhen, China, and is working hard to improve. You should follow them on csdn